<%@ tag language="java" pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/utils/includes.jsp"%>
<%@ attribute name="requestString" type="java.lang.String" required="true" rtexprvalue="true"%>
<%@ attribute name="placeHolder" type="java.lang.String" required="true" rtexprvalue="true"%>
<%@ attribute name="method" type="java.lang.String" required="false" rtexprvalue="true"%>
<%@ attribute name="handler" type="java.lang.String" required="false" rtexprvalue="true"%>

<script type="text/javascript">
$(document).ready(
    function() {
<c:if test="${handler != null}">$("#${handler}").click ( function() {</c:if>
        $.${method == null ? 'get' : method}("${requestString}", {'ajax' : true}).success (
            function(responseText) {
               $("#${placeHolder}").html(responseText);
            }
        )
<c:if test="${handler != null}">});</c:if>
    }
);
</script>